package com.br.facto;

import java.io.Serializable;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;

public class CPesquisaVoo extends Activity implements Serializable,OnClickListener {

	private ImageButton imgBusPorNum;
	private ImageButton imgBusPorCia;
	private ImageButton imgBusPorAer;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// setContentView(R.layout.activity_principal);
		setContentView(R.layout.pesqvoo);
		//montando os botoes na tela
		montaBotoes();
		
		
	}
	/********************************************************************/
	/*Metodo que trata eventos de click
	 */
	public void onClick(View v) 
	{	//muda para tela por aeroporto e numero
		if(v.getId() == R.id.imgBporNumero)
		{
			Intent in = new Intent(this,CPesqAeroNum.class);
			startActivity(in);
			finish();
		}
		//muda para tela de busca por compania
		if(v.getId() == R.id.imgBporCiaAerea)
		{
		    Intent in = new Intent(this,CPesVooByCompania.class);
		    startActivity(in);
		    finish();
		}
		//mudando para a tela dee pesquisa de aeroporto chegada e partida
		if(v.getId() == R.id.imgBporAeroporto)
		{
		    Intent inn = new Intent(this,CPesqVooAero.class);
		    startActivity(inn);
		    finish();
		}
		
		
		
	}
	
	/***************************************************************************
	 * Metodo que instancia e monta os botoes
	 */
	public void montaBotoes()
	{
		imgBusPorAer = (ImageButton)findViewById(R.id.imgBporAeroporto);
		imgBusPorAer.setOnClickListener(this);
		//
		imgBusPorCia = (ImageButton)findViewById(R.id.imgBporCiaAerea);
		imgBusPorCia.setOnClickListener(this);
		//
		imgBusPorNum = (ImageButton)findViewById(R.id.imgBporNumero);
		imgBusPorNum.setOnClickListener(this);
	}
	/****************************************************************************/
}
